import com.mars.bean.A;
import com.mars.bean.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Mytest {
    public static void main(String[] args) {

//        ApplicationContext ac = new ClassPathXmlApplicationContext("beans.xml");
        //当xml加载的时候，所有对象都被实例化了
        //接下来要用哪个就拿哪个

//        User user = (User) ac.getBean("User2");
//        System.out.println(user.getAge());

        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        A a = (A) ac.getBean("AA");
        System.out.println(a.getName());


    }
}
